<style>
    #categories-table tbody td {
        cursor: pointer;
    }

    #categories-table tbody tr.selected td {
        background-color: #38b6d0 !important;
        color: #fff;
    }

    #categories-table tbody tr.selected td .text-muted {
        color: #eee;
    }
    #collections_tbl_list tbody tr.editing td{
        background-color: #c5fffa !important;
        border-top: 1px solid #004ec9 !important;
        border-bottom: 1px solid #004ec9 !important;
    }
    li{
        list-style-type: none;
    }
    #collections_tbl_list tbody tr.row_error td{
        background-color: #ff4610;
        /*border-top: 1px solid #004ec9 !important;
        border-bottom: 1px solid #004ec9 !important;*/
    }

    .save_row_btn,.split_payment_btn,.delete_row_btn{
        padding: 2px 6px;
    }
    .delete_row_btn{
        margin-left: 2px;
    }
    .input-sm{
        padding: 1px 3px !important;
    }
    .panel .table tr.editing td, .panel .table tr.saving td{
        padding: 2px 7px !important;
    }
    .panel .table-striped > thead th {
        background: #e5e7eb !important;
        border-right: 1px solid #c1c5c9;
    }
    .form-inline .form-control {
        display: block;
    }
    .row_currency{
        margin-right: 2px;
    }
    .row_payment_type{
        margin-right: 2px;
    }
    .row_amount{
        margin-right: 0px !important;
    }
    .panel .table td, .panel .table th {
        padding: 6px 5px;
    }
    .input-s-m {
        width: 80px;
    }
</style>

<div class="" id="container">

    <?php echo $this->element('contributions/jump_menu'); ?>

    <div class="row">
        <div class="col-lg-12">
        <section class="panel">
            <header class="panel-heading h3">
                History
            </header>
            <div class="row text-sm wrapper">
                <div class="col-sm-12 m-b-xs">
                    <form class="bs-example form-inline" id="collection_form_settings" onsubmit="return false;">
                        <div class="form-group">
                            <label class="" style="font-size: 15px; margin-top: 25px;">
                                Filter : &nbsp;
                            </label>
                        </div>
                        <div class="form-group">
                            <label class="" style="font-size: 13px;">
                                Receipt Date
                            </label>
                            <input type="text" id="query_receipt_dt" class="form-control input-sm" placeholder=" YYYY-MM-DD">
                        </div>
                        <div class="form-group">
                            <label class="" style="font-size: 13px;">
                                Receipt No
                            </label>
                            <input type="text" id="query_receipt_no" class="form-control input-sm" placeholder="Receipt No">
                        </div>
                        <div class="form-group">
                            <label class="" style="font-size: 13px;">
                                Member No
                            </label>
                            <input type="text" id="query_member_no" class="form-control input-sm" placeholder="Member No">
                            <input type="hidden" id="query_hidden_member_no">
                        </div>
                        <div class="form-group">
                            <label class="" style="font-size: 13px;">
                                Contribution Type
                            </label>
                            <select id="query_contribution_type" class="form-control inline input-sm">
                                <option value="0">
                                    -- All Types --
                                </option>
                                <?php
                                foreach ($contribution_types as $item) {
                                    ?>
                                    <option  value="<?php echo $item['id']; ?>">
                                        <?php echo $item['name']; ?>
                                    </option>
                                <?php
                                }
                                ?>
                            </select>
                        </div>
                        <div class="form-group">
                            <label class="" style="font-size: 13px;">
                                Currency
                            </label>
                            <select id="query_currency" class="form-control inline input-sm">
                                <option value="0">
                                    -- All --
                                </option>
                                <?php
                                foreach ($currencies_list as $key => $item) {
                                    ?>
                                    <option  value="<?php echo $key; ?>">
                                        <?php echo $item; ?>
                                    </option>
                                <?php
                                }
                                ?>
                            </select>
                        </div>
                        <div class="form-group">
                            <label class="" style="font-size: 13px;">
                                Payment Type
                            </label>
                            <select id="query_payment_type" class="form-control inline input-sm">
                                <option value="0">
                                    -- All --
                                </option>
                                <?php
                                foreach ($payment_types as $key => $item) {
                                    ?>
                                    <option  value="<?php echo $item['id']; ?>">
                                        <?php echo $item['name']; ?>
                                    </option>
                                <?php
                                }
                                ?>
                            </select>
                        </div>
                        <div class="form-group">
                            <button type="button" id="filter_apply" class="btn btn-sm btn-info" style="margin-top: 25px;"> Apply </button>
                            <button type="button" id="clear_btn" class="btn btn-sm btn-inverse" style="margin-top: 25px;"> Clear Filter </button>
                        </div>
                    </form>
                </div>

            </div>
            <div class="row text-sm wrapper">
                <div class="col-lg-12" id="history_content"></div>
            </div>

            <!-- Modal -->
            <div class="modal fade bs-example-modal-sm" id="split_payment_modal" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
                <div class="modal-dialog modal-sm">
                    <div class="modal-content">

                    </div>
                </div>
            </div>

        </section>

        </div>
    </div>

</div>

<input type="hidden" id="history_url" value="<?php echo $this->Html->url(array('action' => 'history')); ?>"/>
<input type="hidden" id="contacts-autocomplete-url" value="<?php echo $this->Html->url(array('action' => 'members_list')); ?>"/>

<script type="application/javascript">
    var contribution_types = <?php echo json_encode($contribution_types); ?>;
    var weeks = <?php echo json_encode($weeks); ?>;
    var months = <?php echo json_encode($months); ?>;
    var years = <?php echo json_encode($years); ?>;
    var default_currency = <?php echo json_encode($default_currency); ?>;
    var currencies_list = <?php echo json_encode($currencies_list); ?>;
    var payment_types = <?php echo json_encode($payment_types); ?>;
</script>
<?php
/*echo $this->Html->script('plugins/jquery.trocar/jquery.trocar.js');
echo $this->Html->script('plugins/jquery.friendurl/jquery.friendurl.min.js');*/
echo $this->Html->script('app/views/organisations/contribution_history.js');
?>